home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
045a
/
tpapi1.zip
/
SETLOGIN.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1991-12-04
|
3KB
|
107 lines
{***************************************************************************}
{** Program : SETLOGIN.PAS **}
{***************************************************************************}
{** Version : 1.0 ** Started : 19/12/90 ** Ended : 19/12/90 **}
{***************************************************************************}
{******************************** Description ******************************}
{***************************************************************************}
{** SETLOGIN allows the SUPERVISOR or a console operator to enable or **}
{** disable login on a file server. The user must be sitting on the file **}
{** server where login is to be enabled or disabled. **}
{** **}
{** **}
{***************************************************************************}
{******************************** Information ******************************}
{***************************************************************************}
{** To enable login use : SETLOGIN TRUE **}
{** To disable login : SETLOGIN FALSE **}
{** **}
{** The user will be informed if the operation was sucessful or not. **}
{** **}
{***************************************************************************}
program SETLOGIN;
uses
crt, nwvar, nwerror, nwfsserv;
const
ProgramName = 'SETLOGIN.EXE';
Version = '1.0';
Description = 'Allows SUPERVISOR or CONSOLE operator to enable / disable login';
var
FileServer : ^FileServerOBJ;
CommandLine : string;
OK : boolean;
{******}
function GetCommandLine : boolean;
begin
OK := true;
if (paramcount < 1) or (FileServer^.CheckConsolePrivileges <> Successful) then
OK := false
else
begin
CommandLine := FileServer^.UppercaseNW (paramstr (1));
if (CommandLine <> 'TRUE') and (CommandLine <> 'FALSE') then
OK := false;
end;
if not OK then
begin
clrscr;
textcolor (white);
writeln;
writeln ('Program : ',ProgramName);
writeln ('Version : ',Version);
writeln ('Description : ',Description);
writeln;
writeln;
textcolor (green);
writeln ('USAGE : ');
writeln;
textcolor (yellow);
writeln ('SETLOGIN [TRUE] [FALSE]');
writeln;
textcolor (white);
writeln ('[TRUE] allow users to login');
writeln ('[FALSE] do not allow users to login');
writeln;
writeln ('You must be SUPERVISOR or a CONSOLE operator!');
halt (1);
end;
if CommandLine = 'TRUE' then
GetCommandLine := true
else
GetCommandLine := false;
end; {procedure GetCommandLine}
{******}
begin
new (FileServer, Init);
if GetCommandLine then
writeln ('Enabling login : ', FileServer^.EnableFileServerLogin = 0)
else
writeln ('Disabling login : ', FileServer^.DisableFileServerLogin = 0);
FileServer^.Done;
dispose (FileServer);
end.